# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kalk
pkgver=23.08.4
pkgrel=0
pkgdesc="A powerful cross-platfrom calculator application"
arch="all !armhf" # Blocked by qt5-qtdeclarative
url="https://invent.kde.org/plasma-mobile/kalk"
license="GPL-3.0-or-later"
depends="qt5-qtfeedback"
makedepends="
	bison
	extra-cmake-modules
	flex
	gmp-dev
	kconfig5-dev
	kcoreaddons5-dev
	ki18n5-dev
	kirigami2-dev
	kunitconversion5-dev
	mpfr-dev
	qt5-qtbase-dev
	qt5-qtfeedback-dev
	qt5-qtquickcontrols2-dev
	samurai
	"
_repo_url="https://invent.kde.org/utilities/kalk.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kalk-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	cd build

	# inputmanagertest_de is broken, https://invent.kde.org/plasma-mobile/kalk/-/issues/25
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "inputmanagertest_de|knumbertest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2c9c341b79cb1d9bf28971c4d388c8f3439f468ff8ad862720e7fa071ac8445f3c1fffcd70c465d77d0e7a97cbc0d51c2ca5153f2c1c48723513c694e27326ab  kalk-23.08.4.tar.xz
"
